{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"float:left; border:none\">\n",
    "   <tr style=\"border:none; background-color: #ffffff\">\n",
    "       <td style=\"border:none\">\n",
    "           <a href=\"http://bokeh.pydata.org/\">     \n",
    "           <img \n",
    "               src=\"assets/bokeh-transparent.png\" \n",
    "               style=\"width:50px\"\n",
    "           >\n",
    "           </a>    \n",
    "       </td>\n",
    "       <td style=\"border:none\">\n",
    "           <h1>Bokeh教程</h1>\n",
    "       </td>\n",
    "   </tr>\n",
    "</table>\n",
    "\n",
    "<div style=\"float:right;\"><h2>02. 样式和主题</h2></div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from bokeh.io import output_notebook, show\n",
    "from bokeh.plotting import figure"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"https://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"0e36a638-7c69-4f68-8c66-9537a500942e\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  var JS_MIME_TYPE = 'application/javascript';\n",
       "  var HTML_MIME_TYPE = 'text/html';\n",
       "  var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
       "  var CLASS_NAME = 'output_bokeh rendered_html';\n",
       "\n",
       "  /**\n",
       "   * Render data to the DOM node\n",
       "   */\n",
       "  function render(props, node) {\n",
       "    var script = document.createElement(\"script\");\n",
       "    node.appendChild(script);\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when an output is cleared or removed\n",
       "   */\n",
       "  function handleClearOutput(event, handle) {\n",
       "    var cell = handle.cell;\n",
       "\n",
       "    var id = cell.output_area._bokeh_element_id;\n",
       "    var server_id = cell.output_area._bokeh_server_id;\n",
       "    // Clean up Bokeh references\n",
       "    if (id !== undefined) {\n",
       "      Bokeh.index[id].model.document.clear();\n",
       "      delete Bokeh.index[id];\n",
       "    }\n",
       "\n",
       "    if (server_id !== undefined) {\n",
       "      // Clean up Bokeh references\n",
       "      var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
       "      cell.notebook.kernel.execute(cmd, {\n",
       "        iopub: {\n",
       "          output: function(msg) {\n",
       "            var element_id = msg.content.text.trim();\n",
       "            Bokeh.index[element_id].model.document.clear();\n",
       "            delete Bokeh.index[element_id];\n",
       "          }\n",
       "        }\n",
       "      });\n",
       "      // Destroy server and session\n",
       "      var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
       "      cell.notebook.kernel.execute(cmd);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when a new output is added\n",
       "   */\n",
       "  function handleAddOutput(event, handle) {\n",
       "    var output_area = handle.output_area;\n",
       "    var output = handle.output;\n",
       "\n",
       "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
       "    if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "      return\n",
       "    }\n",
       "\n",
       "    var toinsert = output_area.element.find(`.${CLASS_NAME.split(' ')[0]}`);\n",
       "\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
       "      toinsert[0].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
       "      // store reference to embed id on output_area\n",
       "      output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "    }\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "      var bk_div = document.createElement(\"div\");\n",
       "      bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "      var script_attrs = bk_div.children[0].attributes;\n",
       "      for (var i = 0; i < script_attrs.length; i++) {\n",
       "        toinsert[0].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "      }\n",
       "      // store reference to server id on output_area\n",
       "      output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function register_renderer(events, OutputArea) {\n",
       "\n",
       "    function append_mime(data, metadata, element) {\n",
       "      // create a DOM node to render to\n",
       "      var toinsert = this.create_output_subarea(\n",
       "        metadata,\n",
       "        CLASS_NAME,\n",
       "        EXEC_MIME_TYPE\n",
       "      );\n",
       "      this.keyboard_manager.register_events(toinsert);\n",
       "      // Render to node\n",
       "      var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "      render(props, toinsert[0]);\n",
       "      element.append(toinsert);\n",
       "      return toinsert\n",
       "    }\n",
       "\n",
       "    /* Handle when an output is cleared or removed */\n",
       "    events.on('clear_output.CodeCell', handleClearOutput);\n",
       "    events.on('delete.Cell', handleClearOutput);\n",
       "\n",
       "    /* Handle when a new output is added */\n",
       "    events.on('output_added.OutputArea', handleAddOutput);\n",
       "\n",
       "    /**\n",
       "     * Register the mime type and append_mime function with output_area\n",
       "     */\n",
       "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "      /* Is output safe? */\n",
       "      safe: true,\n",
       "      /* Index of renderer in `output_area.display_order` */\n",
       "      index: 0\n",
       "    });\n",
       "  }\n",
       "\n",
       "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
       "  if (root.Jupyter !== undefined) {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"0e36a638-7c69-4f68-8c66-9537a500942e\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    }\n",
       "    finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        root._bokeh_is_loading--;\n",
       "        if (root._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };var element = document.getElementById(\"0e36a638-7c69-4f68-8c66-9537a500942e\");\n",
       "  if (element == null) {\n",
       "    console.log(\"Bokeh: ERROR: autoload.js configured with elementid '0e36a638-7c69-4f68-8c66-9537a500942e' but no matching script tag was found. \")\n",
       "    return false;\n",
       "  }\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.10.min.js\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    \n",
       "    function(Bokeh) {\n",
       "      \n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((root.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i].call(root, root.Bokeh);\n",
       "      }if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"0e36a638-7c69-4f68-8c66-9537a500942e\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));"
      ],
      "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n\n  if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n    root._bokeh_onload_callbacks = [];\n    root._bokeh_is_loading = undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  var NB_LOAD_WARNING = {'data': {'text/html':\n     \"<div style='background-color: #fdd'>\\n\"+\n     \"<p>\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"</p>\\n\"+\n     \"<ul>\\n\"+\n     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n     \"</ul>\\n\"+\n     \"<code>\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources=INLINE)\\n\"+\n     \"</code>\\n\"+\n     \"</div>\"}};\n\n  function display_loaded() {\n    var el = document.getElementById(\"0e36a638-7c69-4f68-8c66-9537a500942e\");\n    if (el != null) {\n      el.textContent = \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !== undefined) {\n      if (el != null) {\n        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n    }\n    finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.info(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(js_urls, callback) {\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading > 0) {\n      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls == null || js_urls.length === 0) {\n      run_callbacks();\n      return null;\n    }\n    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading = js_urls.length;\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      var s = document.createElement('script');\n      s.src = url;\n      s.async = false;\n      s.onreadystatechange = s.onload = function() {\n        root._bokeh_is_loading--;\n        if (root._bokeh_is_loading === 0) {\n          console.log(\"Bokeh: all BokehJS libraries loaded\");\n          run_callbacks()\n        }\n      };\n      s.onerror = function() {\n        console.warn(\"failed to load library \" + url);\n      };\n      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.getElementsByTagName(\"head\")[0].appendChild(s);\n    }\n  };var element = document.getElementById(\"0e36a638-7c69-4f68-8c66-9537a500942e\");\n  if (element == null) {\n    console.log(\"Bokeh: ERROR: autoload.js configured with elementid '0e36a638-7c69-4f68-8c66-9537a500942e' but no matching script tag was found. \")\n    return false;\n  }\n\n  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.10.min.js\"];\n\n  var inline_js = [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    \n    function(Bokeh) {\n      \n    },\n    function(Bokeh) {\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n    }\n  ];\n\n  function run_inline_js() {\n    \n    if ((root.Bokeh !== undefined) || (force === true)) {\n      for (var i = 0; i < inline_js.length; i++) {\n        inline_js[i].call(root, root.Bokeh);\n      }if (force === true) {\n        display_loaded();\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    } else if (force !== true) {\n      var cell = $(document.getElementById(\"0e36a638-7c69-4f68-8c66-9537a500942e\")).parents('.cell').data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading === 0) {\n    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(js_urls, function() {\n      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 颜色和属性"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 颜色\n",
    "\n",
    "有许多地方您可能需要指定颜色。Bokeh可以各种不同的方式指定颜色：\n",
    "\n",
    "* 任意一个 [147种CSS颜色名称](http://www.w3schools.com/cssref/css_colornames.asp)，如 ``'green'``, ``'indigo'``\n",
    "* 十六进制的 RGB(A) 值，如， ``'#FF0000'``, ``'#44444444'``\n",
    "* 整数3元组 *(r,g,b)* ，其中整数位于0与255之间\n",
    "* 4元组 *(r,g,b,a)*，其中 *r*, *g*, *b* 是0与255之间的整数，*a* 是0与1之间的浮点数\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## 属性\n",
    "\n",
    "无论用哪个API (``models``, ``plotting``, ``charts``) 创建Bokeh图表，都可以通过设置Bokeh模型对象的属性来定型其视觉样式。视觉样式属性分为三种类型：line, fill, text。相关的代码和示例完整信息，请参见用户指南的 [视觉样式属性](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html) 章节。\n",
    "\n",
    "----\n",
    "\n",
    "### Line 属性\n",
    "\n",
    "设置线条的视觉外观。最常见的是 ``line_color``, ``line_alpha``, ``line_width``， ``line_dash``。\n",
    "\n",
    "### Fill 属性\n",
    "\n",
    "设置填充区域的外观：``fill_color``， ``fill_alpha``。\n",
    "\n",
    "### Text 属性\n",
    "\n",
    "设置文本行的视觉外观。最常见的是 ``text_font``, ``text_font_size``, ``text_color``, ``text_alpha``\n",
    "\n",
    "----\n",
    "\n",
    "有时属性名会有一个前缀，为了区分同一对象的不同line属性，或为了名称更能表达意思。例如，为了设置轮廓线的宽度，可以用 ``myplot.outline_line_width = 2``。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Plots（框图）\n",
    "\n",
    "可以设置plot的多个顶层属性（outline, border等）。请查看样式指南的 [Plots](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#plots) 部分以获得完整信息。\n",
    "\n",
    "下面是一个调整plot轮廓线的例子："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"444ca109-7cb5-47c1-9b5b-2d6d265d9d03\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"9a32188d-7518-4383-9dfe-0c4782e6515e\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"b2b77a0f-8011-4c75-a21c-4c528341216e\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5a753a78-e8b0-4f88-ba53-cb5c211047a2\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"ecbea60f-77d5-4594-ad0d-b79795ed3977\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"cec7f881-63fa-4b51-aba6-6953df001028\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"9dc55f6b-9155-42c5-ae07-66645e61f308\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":{\"id\":\"8001d1de-9975-47e0-868d-5af5b539f562\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"cec7f881-63fa-4b51-aba6-6953df001028\",\"type\":\"BasicTicker\"}},\"id\":\"22016591-ecef-4616-90a8-e1542a25309c\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"47955f4d-86af-4d27-8a69-3b2b481bad9b\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"8001d1de-9975-47e0-868d-5af5b539f562\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"21e3518d-63fc-43b8-8b66-226627e62563\",\"type\":\"BasicTicker\"}},\"id\":\"a70a4cb1-5d94-475d-863d-3eac20d80644\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"21e3518d-63fc-43b8-8b66-226627e62563\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"8001d1de-9975-47e0-868d-5af5b539f562\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"21e3518d-63fc-43b8-8b66-226627e62563\",\"type\":\"BasicTicker\"}},\"id\":\"5b5463c0-85b9-41e5-90a4-8b9b4e756719\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"9a329aa7-ceef-4d51-8a93-0e20dce687a0\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7a5e6bd0-e842-4deb-8d01-c296b55edb2d\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"b63b999d-aa21-4e52-a179-a80b47f14b45\",\"type\":\"ColumnDataSource\"}},\"id\":\"6138fecf-5b1b-4e66-b784-5ae454823236\",\"type\":\"CDSView\"},{\"attributes\":{\"below\":[{\"id\":\"1b44b243-b628-4736-96d4-dd6ad137a959\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"a70a4cb1-5d94-475d-863d-3eac20d80644\",\"type\":\"LinearAxis\"}],\"outline_line_alpha\":{\"value\":0.3},\"outline_line_color\":{\"value\":\"navy\"},\"outline_line_width\":{\"value\":7},\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1b44b243-b628-4736-96d4-dd6ad137a959\",\"type\":\"LinearAxis\"},{\"id\":\"22016591-ecef-4616-90a8-e1542a25309c\",\"type\":\"Grid\"},{\"id\":\"a70a4cb1-5d94-475d-863d-3eac20d80644\",\"type\":\"LinearAxis\"},{\"id\":\"5b5463c0-85b9-41e5-90a4-8b9b4e756719\",\"type\":\"Grid\"},{\"id\":\"9a329aa7-ceef-4d51-8a93-0e20dce687a0\",\"type\":\"BoxAnnotation\"},{\"id\":\"61a1bee5-8646-4e5d-b77d-4c002cd918d9\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"54856050-2a69-46e6-adf7-f6abb672d1e7\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"e98db3d1-ac86-4ebb-a50e-29d413ea179d\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"3385d148-f499-411e-adda-dac324fdcb31\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"e766fb88-9562-4a85-a097-7818291445b3\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"acd74028-942c-4129-9f69-588768110d98\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"13ec00ec-78f6-4e6c-a261-ca61c0ba0f53\",\"type\":\"LinearScale\"}},\"id\":\"8001d1de-9975-47e0-868d-5af5b539f562\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"b63b999d-aa21-4e52-a179-a80b47f14b45\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"dfa9eb90-27be-4cb8-9e11-f50d33454345\",\"type\":\"PanTool\"},{\"id\":\"c52ecfe0-c891-431c-8708-64718f2d5eed\",\"type\":\"WheelZoomTool\"},{\"id\":\"9cc8f2fa-5d1f-4e43-b5ad-813335981f4a\",\"type\":\"BoxZoomTool\"},{\"id\":\"b2b77a0f-8011-4c75-a21c-4c528341216e\",\"type\":\"SaveTool\"},{\"id\":\"ecbea60f-77d5-4594-ad0d-b79795ed3977\",\"type\":\"ResetTool\"},{\"id\":\"9dc55f6b-9155-42c5-ae07-66645e61f308\",\"type\":\"HelpTool\"}]},\"id\":\"e98db3d1-ac86-4ebb-a50e-29d413ea179d\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"8de26ff7-cedd-480f-8f18-4c5d2f466227\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"3385d148-f499-411e-adda-dac324fdcb31\",\"type\":\"DataRange1d\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"54856050-2a69-46e6-adf7-f6abb672d1e7\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"47955f4d-86af-4d27-8a69-3b2b481bad9b\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"acd74028-942c-4129-9f69-588768110d98\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"dfa9eb90-27be-4cb8-9e11-f50d33454345\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"e766fb88-9562-4a85-a097-7818291445b3\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"b63b999d-aa21-4e52-a179-a80b47f14b45\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7a5e6bd0-e842-4deb-8d01-c296b55edb2d\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5a753a78-e8b0-4f88-ba53-cb5c211047a2\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"6138fecf-5b1b-4e66-b784-5ae454823236\",\"type\":\"CDSView\"}},\"id\":\"61a1bee5-8646-4e5d-b77d-4c002cd918d9\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"13ec00ec-78f6-4e6c-a261-ca61c0ba0f53\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"c52ecfe0-c891-431c-8708-64718f2d5eed\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"9a329aa7-ceef-4d51-8a93-0e20dce687a0\",\"type\":\"BoxAnnotation\"}},\"id\":\"9cc8f2fa-5d1f-4e43-b5ad-813335981f4a\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"formatter\":{\"id\":\"8de26ff7-cedd-480f-8f18-4c5d2f466227\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"8001d1de-9975-47e0-868d-5af5b539f562\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"cec7f881-63fa-4b51-aba6-6953df001028\",\"type\":\"BasicTicker\"}},\"id\":\"1b44b243-b628-4736-96d4-dd6ad137a959\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"8001d1de-9975-47e0-868d-5af5b539f562\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"9a32188d-7518-4383-9dfe-0c4782e6515e\",\"elementid\":\"444ca109-7cb5-47c1-9b5b-2d6d265d9d03\",\"modelid\":\"8001d1de-9975-47e0-868d-5af5b539f562\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "8001d1de-9975-47e0-868d-5af5b539f562"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# create a new plot with a title\n",
    "p = figure(plot_width=400, plot_height=400)\n",
    "p.outline_line_width = 7\n",
    "p.outline_line_alpha = 0.3\n",
    "p.outline_line_color = \"navy\"\n",
    "\n",
    "p.circle([1,2,3,4,5], [2,5,8,2,7], size=10)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE Create a plot of your own and customize several plot-level properties\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Glyphs（标记符号）\n",
    "\n",
    "我们可以对glyph对象的视觉属性进行设计。当使用 `bokeh.plotting` 时，通常在调用glyph方法时指定，如：\n",
    "```python\n",
    "p.circle(line_color=\"red\", fill_alpha=0.2, ...)\n",
    "```\n",
    "也可以直接设置glyph对象的属性。Glyph对象是 `GlyphRenderer` 找到的对象，由 `Plot.add_glyph` 和 `circle`, `rect` 这样的 `bokeh.plotting` glyph方法返回。我们看一个例子："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"c61a46dd-98f2-4600-a053-bc5411c974eb\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"79def2c2-804d-4684-838e-75b33745d1bb\":{\"roots\":{\"references\":[{\"attributes\":{\"formatter\":{\"id\":\"27a396ad-d016-40c1-abe7-5b69c25d6067\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"be08b12a-fdf3-4147-9e33-347c03980987\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a90e871e-f1f0-4e45-a612-5181ab05b8c2\",\"type\":\"BasicTicker\"}},\"id\":\"7538b317-50ef-4e72-9071-4efc7bbaa3f6\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"be08b12a-fdf3-4147-9e33-347c03980987\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a90e871e-f1f0-4e45-a612-5181ab05b8c2\",\"type\":\"BasicTicker\"}},\"id\":\"a3235217-48d1-470d-ac37-def4a719e1c4\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5f231d3b-9867-487e-8bcf-35ec4aa14638\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8dbd9ac2-17bc-4683-ac15-1b324ada95b2\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"3897dcc7-5e0c-409b-b6a0-443a15fcac71\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null},\"id\":\"7cbe8b31-d9b7-4b09-8376-38e4eb14ca5c\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.2},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"firebrick\"},\"line_dash\":[5,1],\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":50},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6a6bc471-894b-4c24-8446-39168bb3c491\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"9918cf95-544a-4c4c-a66e-27c116c75ad5\",\"type\":\"PanTool\"},{\"attributes\":{\"below\":[{\"id\":\"7538b317-50ef-4e72-9071-4efc7bbaa3f6\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"a88917d5-0216-448a-8970-66e043c132b0\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"7538b317-50ef-4e72-9071-4efc7bbaa3f6\",\"type\":\"LinearAxis\"},{\"id\":\"a3235217-48d1-470d-ac37-def4a719e1c4\",\"type\":\"Grid\"},{\"id\":\"a88917d5-0216-448a-8970-66e043c132b0\",\"type\":\"LinearAxis\"},{\"id\":\"cb9e9e1d-5afc-4b3f-bf7a-abd1fdf713c2\",\"type\":\"Grid\"},{\"id\":\"49b6046f-c763-4771-bc18-50d2902fb484\",\"type\":\"BoxAnnotation\"},{\"id\":\"ffa1b7cd-b434-4a72-a517-4903e23bddb8\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"d1b9e3e9-8f0f-4900-8fa8-57835cc72305\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"fdf4b19f-6e27-491b-a1cb-d91fb1cadf94\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"7cbe8b31-d9b7-4b09-8376-38e4eb14ca5c\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"ea3e29e4-1f91-4352-85fd-c60ab15626f9\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"64d89cc7-340e-4e96-a52a-6ef2fc34a052\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"5f231d3b-9867-487e-8bcf-35ec4aa14638\",\"type\":\"LinearScale\"}},\"id\":\"be08b12a-fdf3-4147-9e33-347c03980987\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"49b6046f-c763-4771-bc18-50d2902fb484\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"fd4733a8-f844-4595-b79f-c35bbfc0e46f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"14a20b48-df61-4627-a5d6-72bca42ce552\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"d1b9e3e9-8f0f-4900-8fa8-57835cc72305\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"9918cf95-544a-4c4c-a66e-27c116c75ad5\",\"type\":\"PanTool\"},{\"id\":\"8d5beb9a-494b-4ac7-bbcd-a201f94c429c\",\"type\":\"WheelZoomTool\"},{\"id\":\"2d280f96-45f2-4a30-9874-cec40bf2ab44\",\"type\":\"BoxZoomTool\"},{\"id\":\"fbb3a324-b4e7-44b2-a193-620863c54e15\",\"type\":\"SaveTool\"},{\"id\":\"3d1d3230-9876-4016-86c8-4931e7a161d1\",\"type\":\"ResetTool\"},{\"id\":\"14a20b48-df61-4627-a5d6-72bca42ce552\",\"type\":\"HelpTool\"}]},\"id\":\"fdf4b19f-6e27-491b-a1cb-d91fb1cadf94\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"3d1d3230-9876-4016-86c8-4931e7a161d1\",\"type\":\"ResetTool\"},{\"attributes\":{\"source\":{\"id\":\"3897dcc7-5e0c-409b-b6a0-443a15fcac71\",\"type\":\"ColumnDataSource\"}},\"id\":\"698c4f38-1062-43ce-9f79-9106de5beb1f\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"fbb3a324-b4e7-44b2-a193-620863c54e15\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"3897dcc7-5e0c-409b-b6a0-443a15fcac71\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6a6bc471-894b-4c24-8446-39168bb3c491\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"8dbd9ac2-17bc-4683-ac15-1b324ada95b2\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"698c4f38-1062-43ce-9f79-9106de5beb1f\",\"type\":\"CDSView\"}},\"id\":\"ffa1b7cd-b434-4a72-a517-4903e23bddb8\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"49b6046f-c763-4771-bc18-50d2902fb484\",\"type\":\"BoxAnnotation\"}},\"id\":\"2d280f96-45f2-4a30-9874-cec40bf2ab44\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"ea3e29e4-1f91-4352-85fd-c60ab15626f9\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"8d5beb9a-494b-4ac7-bbcd-a201f94c429c\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"27a396ad-d016-40c1-abe7-5b69c25d6067\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"8f5cf546-1e42-4b5c-894b-77bb8938d27d\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"be08b12a-fdf3-4147-9e33-347c03980987\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"8f5cf546-1e42-4b5c-894b-77bb8938d27d\",\"type\":\"BasicTicker\"}},\"id\":\"cb9e9e1d-5afc-4b3f-bf7a-abd1fdf713c2\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"64d89cc7-340e-4e96-a52a-6ef2fc34a052\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"fd4733a8-f844-4595-b79f-c35bbfc0e46f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"be08b12a-fdf3-4147-9e33-347c03980987\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"8f5cf546-1e42-4b5c-894b-77bb8938d27d\",\"type\":\"BasicTicker\"}},\"id\":\"a88917d5-0216-448a-8970-66e043c132b0\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"a90e871e-f1f0-4e45-a612-5181ab05b8c2\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"be08b12a-fdf3-4147-9e33-347c03980987\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"79def2c2-804d-4684-838e-75b33745d1bb\",\"elementid\":\"c61a46dd-98f2-4600-a053-bc5411c974eb\",\"modelid\":\"be08b12a-fdf3-4147-9e33-347c03980987\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "be08b12a-fdf3-4147-9e33-347c03980987"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = figure(plot_width=400, plot_height=400)\n",
    "\n",
    "# keep a reference to the returned GlyphRenderer\n",
    "r = p.circle([1,2,3,4,5], [2,5,8,2,7])\n",
    "\n",
    "r.glyph.size = 50\n",
    "r.glyph.fill_alpha = 0.2\n",
    "r.glyph.line_color = \"firebrick\"\n",
    "r.glyph.line_dash = [5, 1]\n",
    "r.glyph.line_width = 2\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 选择和非选择 视觉效果\n",
    "\n",
    "你可以控制被选择的glyphs看起来是怎么样的。“被选择”的点根据`GlyphRenderer`的`.selection_glyph`属性选项显示：\n",
    "```python\n",
    "r.selection_glyph = Circle(fill_alpha=1, fill_color=\"firebrick\", line_color=None) \n",
    "```\n",
    "\n",
    "如果设置了“非选择”，则未被选择的点按照`GlyphRenderer`的`.nonselection_glyph`属性选项显示：\n",
    "```python\n",
    "r.nonselection_glyph = Circle(fill_alpha=0.2, fill_color=\"grey\", line_color=None) \n",
    "```\n",
    "\n",
    "使用`bokeh.plotting`接口时，将这些视觉属性传递给glyph方法比较容易，如下所示。glyph方法将创建的选择或非选择glyph并渲染。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"0be624f0-17d9-4356-849d-d76dada205aa\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"09bd144e-38bd-4f8e-a1b8-6b1bdfafc363\":{\"roots\":{\"references\":[{\"attributes\":{\"fill_color\":{\"value\":\"firebrick\"},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":50},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"b422cd0e-c851-44eb-a348-2de2950e62bc\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null},\"id\":\"850b266b-b74f-4786-bb52-b6482f9df7ac\",\"type\":\"TapTool\"},{\"attributes\":{\"source\":{\"id\":\"b063933f-05ba-4c90-b092-dc16c76001bc\",\"type\":\"ColumnDataSource\"}},\"id\":\"3128f63c-e9ce-4cba-8af7-21a54d6eb240\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.2},\"fill_color\":{\"value\":\"grey\"},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":50},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"56308bfb-c2c8-4abb-87d0-c7dd808de206\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"b063933f-05ba-4c90-b092-dc16c76001bc\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"bc9cc215-acc6-4b44-8ae5-384b607c76b2\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"Select a circle\"},\"id\":\"23b21051-caf2-448b-af96-0c3348ef1189\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"b063933f-05ba-4c90-b092-dc16c76001bc\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2efe0b6e-f04d-487e-95f1-23d621c313bc\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"56308bfb-c2c8-4abb-87d0-c7dd808de206\",\"type\":\"Circle\"},\"selection_glyph\":{\"id\":\"b422cd0e-c851-44eb-a348-2de2950e62bc\",\"type\":\"Circle\"},\"view\":{\"id\":\"3128f63c-e9ce-4cba-8af7-21a54d6eb240\",\"type\":\"CDSView\"}},\"id\":\"f45c9981-a426-4c76-a920-748b7fc8a727\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"0b5d86a7-1d0a-4b90-b5dd-8ec1ba4b32eb\",\"type\":\"LinearScale\"},{\"attributes\":{\"below\":[{\"id\":\"60382c9e-065e-4762-b319-ef9caaf574b6\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"9eacdc0b-a1f3-4462-9641-188ed9856deb\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"60382c9e-065e-4762-b319-ef9caaf574b6\",\"type\":\"LinearAxis\"},{\"id\":\"c8358050-3e75-414c-a0ba-fdfa02fcfc8e\",\"type\":\"Grid\"},{\"id\":\"9eacdc0b-a1f3-4462-9641-188ed9856deb\",\"type\":\"LinearAxis\"},{\"id\":\"abf825e5-c6c1-4673-b5df-51262e02ad20\",\"type\":\"Grid\"},{\"id\":\"f45c9981-a426-4c76-a920-748b7fc8a727\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"23b21051-caf2-448b-af96-0c3348ef1189\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"aa0fec22-dcf0-4cc8-80b5-24dd66275bd2\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"ad7bf681-681a-4f3d-a6ff-240e258cf8f3\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"66608f70-56f0-476b-a88c-751105795ad4\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"72ccd435-d7e8-426f-baae-69305acf1374\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"0b5d86a7-1d0a-4b90-b5dd-8ec1ba4b32eb\",\"type\":\"LinearScale\"}},\"id\":\"2e75ef4f-a09c-4919-b8a0-09d5826bc941\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"a2b6ea0e-e907-4908-bc45-6d9cd60c00ee\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"2e75ef4f-a09c-4919-b8a0-09d5826bc941\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0c54dc6d-153a-407e-90bd-4a319f19de2e\",\"type\":\"BasicTicker\"}},\"id\":\"c8358050-3e75-414c-a0ba-fdfa02fcfc8e\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"a2b6ea0e-e907-4908-bc45-6d9cd60c00ee\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2e75ef4f-a09c-4919-b8a0-09d5826bc941\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0c54dc6d-153a-407e-90bd-4a319f19de2e\",\"type\":\"BasicTicker\"}},\"id\":\"60382c9e-065e-4762-b319-ef9caaf574b6\",\"type\":\"LinearAxis\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"850b266b-b74f-4786-bb52-b6482f9df7ac\",\"type\":\"TapTool\"}]},\"id\":\"aa0fec22-dcf0-4cc8-80b5-24dd66275bd2\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"0c54dc6d-153a-407e-90bd-4a319f19de2e\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"bc9cc215-acc6-4b44-8ae5-384b607c76b2\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2e75ef4f-a09c-4919-b8a0-09d5826bc941\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"526c8fc2-147b-4c11-8b17-328d7fe01b21\",\"type\":\"BasicTicker\"}},\"id\":\"9eacdc0b-a1f3-4462-9641-188ed9856deb\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"526c8fc2-147b-4c11-8b17-328d7fe01b21\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"ad7bf681-681a-4f3d-a6ff-240e258cf8f3\",\"type\":\"DataRange1d\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"2e75ef4f-a09c-4919-b8a0-09d5826bc941\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"526c8fc2-147b-4c11-8b17-328d7fe01b21\",\"type\":\"BasicTicker\"}},\"id\":\"abf825e5-c6c1-4673-b5df-51262e02ad20\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":50},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2efe0b6e-f04d-487e-95f1-23d621c313bc\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null},\"id\":\"72ccd435-d7e8-426f-baae-69305acf1374\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"66608f70-56f0-476b-a88c-751105795ad4\",\"type\":\"LinearScale\"}],\"root_ids\":[\"2e75ef4f-a09c-4919-b8a0-09d5826bc941\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"09bd144e-38bd-4f8e-a1b8-6b1bdfafc363\",\"elementid\":\"0be624f0-17d9-4356-849d-d76dada205aa\",\"modelid\":\"2e75ef4f-a09c-4919-b8a0-09d5826bc941\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "2e75ef4f-a09c-4919-b8a0-09d5826bc941"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = figure(plot_width=400, plot_height=400, tools=\"tap\", title=\"Select a circle\")\n",
    "renderer = p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=50,\n",
    "\n",
    "                    # set visual properties for selected glyphs\n",
    "                    selection_color=\"firebrick\",\n",
    "\n",
    "                    # set visual properties for non-selected glyphs\n",
    "                    nonselection_fill_alpha=0.2,\n",
    "                    nonselection_fill_color=\"grey\",\n",
    "                    nonselection_line_color=\"firebrick\",\n",
    "                    nonselection_line_alpha=1.0)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以指定被“inspected”的glyph的视觉外观，例如，由一个悬停工具。这通过设置`GlyphRenderer`的一个可选属性`hover_glyph`完成：\n",
    "```python\n",
    "r.hover_glyph = Circle(fill_alpha=1, fill_color=\"firebrick\", line_color=None) \n",
    "```\n",
    "\n",
    "如果使用`bokeh.plotting`，则可以通过给glyph方法传递`hover_fill_alpha`参数。让我们看一个采用\"hline\"模式配置`HoverTool`的例子。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"61edb807-1130-481f-ac6e-863f4b970eb0\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"b6e9e80a-9145-433b-8744-df6c961c8313\":{\"roots\":{\"references\":[{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":{\"__ndarray__\":\"AADyke23ckIAADDb7bdyQgAAbiTut3JCAACsbe63ckIAAOq27rdyQgAAKADvt3JCAABmSe+3ckIAAKSS77dyQgAA4tvvt3JCAAAgJfC3ckIAAF5u8LdyQgAAnLfwt3JCAADaAPG3ckIAABhK8bdyQgAAVpPxt3JCAACU3PG3ckIAANIl8rdyQgAAEG/yt3JCAABOuPK3ckIAAIwB87dyQgAAykrzt3JCAAAIlPO3ckIAAEbd87dyQgAAhCb0t3JCAADCb/S3ckIAAAC59LdyQgAAPgL1t3JCAAB8S/W3ckIAALqU9bdyQgAA+N31t3JCAAA2J/a3ckIAAHRw9rdyQgAAsrn2t3JCAADwAve3ckIAAC5M97dyQgAAbJX3t3JCAACq3ve3ckIAAOgn+LdyQgAAJnH4t3JCAABkuvi3ckIAAKID+bdyQgAA4Ez5t3JCAAAelvm3ckIAAFzf+bdyQgAAmij6t3JCAADYcfq3ckIAABa7+rdyQgAAVAT7t3JCAACSTfu3ckIAANCW+7dyQgAADuD7t3JCAABMKfy3ckIAAIpy/LdyQgAAyLv8t3JCAAAGBf23ckIAAERO/bdyQgAAgpf9t3JCAADA4P23ckIAAP4p/rdyQgAAPHP+t3JCAAB6vP63ckIAALgF/7dyQgAA9k7/t3JCAAA0mP+3ckIAAHLh/7dyQgAAsCoAuHJCAADucwC4ckIAACy9ALhyQgAAagYBuHJCAACoTwG4ckIAAOaYAbhyQgAAJOIBuHJCAABiKwK4ckIAAKB0ArhyQgAA3r0CuHJCAAAcBwO4ckIAAFpQA7hyQgAAmJkDuHJCAADW4gO4ckIAABQsBLhyQgAAUnUEuHJCAACQvgS4ckIAAM4HBbhyQgAADFEFuHJCAABKmgW4ckIAAIjjBbhyQgAAxiwGuHJCAAAEdga4ckIAAEK/BrhyQgAAgAgHuHJCAAC+UQe4ckIAAPyaB7hyQgAAOuQHuHJCAAB4LQi4ckIAALZ2CLhyQgAA9L8IuHJCAAAyCQm4ckIAAHBSCbhyQgAArpsJuHJCAADs5Am4ckIAACouCrhyQgAAaHcKuHJCAACmwAq4ckIAAOQJC7hyQgAAIlMLuHJCAABgnAu4ckIAAJ7lC7hyQgAA3C4MuHJCAAAaeAy4ckIAAFjBDLhyQgAAlgoNuHJCAADUUw24ckIAABKdDbhyQgAAUOYNuHJCAACOLw64ckIAAMx4DrhyQgAACsIOuHJCAABICw+4ckIAAIZUD7hyQgAAxJ0PuHJCAAAC5w+4ckIAAEAwELhyQgAAfnkQuHJCAAC8whC4ckIAAPoLEbhyQgAAOFURuHJCAAB2nhG4ckIAALTnEbhyQgAA8jASuHJCAAAwehK4ckIAAG7DErhyQgAArAwTuHJCAADqVRO4ckIAACifE7hyQgAAZugTuHJCAACkMRS4ckIAAOJ6FLhyQgAAIMQUuHJCAABeDRW4ckIAAJxWFbhyQgAA2p8VuHJCAAAY6RW4ckIAAFYyFrhyQgAAlHsWuHJCAADSxBa4ckIAABAOF7hyQgAATlcXuHJCAACMoBe4ckIAAMrpF7hyQgAACDMYuHJCAABGfBi4ckIAAITFGLhyQgAAwg4ZuHJCAAAAWBm4ckIAAD6hGbhyQgAAfOoZuHJCAAC6Mxq4ckIAAPh8GrhyQgAANsYauHJCAAB0Dxu4ckIAALJYG7hyQgAA8KEbuHJCAAAu6xu4ckIAAGw0HLhyQgAAqn0cuHJCAADoxhy4ckIAACYQHbhyQgAAZFkduHJCAACioh24ckIAAODrHbhyQgAAHjUeuHJCAABcfh64ckIAAJrHHrhyQgAA2BAfuHJCAAAWWh+4ckIAAFSjH7hyQgAAkuwfuHJCAADQNSC4ckIAAA5/ILhyQgAATMgguHJCAACKESG4ckIAAMhaIbhyQgAABqQhuHJCAABE7SG4ckIAAII2IrhyQgAAwH8iuHJCAAD+yCK4ckIAADwSI7hyQgAAelsjuHJCAAC4pCO4ckIAAPbtI7hyQgAANDckuHJCAABygCS4ckIAALDJJLhyQgAA7hIluHJCAAAsXCW4ckIAAGqlJbhyQgAAqO4luHJCAADmNya4ckIAACSBJrhyQgAAYsomuHJCAACgEye4ckIAAN5cJ7hyQgAAHKYnuHJCAABa7ye4ckIAAJg4KLhyQgAA1oEouHJCAAAUyyi4ckIAAFIUKbhyQgAAkF0puHJCAADOpim4ckIAAAzwKbhyQgAASjkquHJCAACIgiq4ckIAAMbLKrhyQgAABBUruHJCAABCXiu4ckIAAICnK7hyQgAAvvAruHJCAAD8OSy4ckIAADqDLLhyQgAAeMwsuHJCAAC2FS24ckIAAPReLbhyQgAAMqgtuHJCAABw8S24ckIAAK46LrhyQgAA7IMuuHJCAAAqzS64ckIAAGgWL7hyQgAApl8vuHJCAADkqC+4ckIAACLyL7hyQgAAYDswuHJCAACehDC4ckIAANzNMLhyQgAAGhcxuHJCAABYYDG4ckIAAJapMbhyQgAA1PIxuHJCAAASPDK4ckIAAFCFMrhyQgAAjs4yuHJCAADMFzO4ckIAAAphM7hyQgAASKozuHJCAACG8zO4ckIAAMQ8NLhyQgAAAoY0uHJCAABAzzS4ckIAAH4YNbhyQgAAvGE1uHJCAAD6qjW4ckIAADj0NbhyQgAAdj02uHJCAAC0hja4ckIAAPLPNrhyQgAAMBk3uHJCAABuYje4ckIAAKyrN7hyQgAA6vQ3uHJCAAAoPji4ckIAAGaHOLhyQgAApNA4uHJCAADiGTm4ckIAACBjObhyQgAAXqw5uHJCAACc9Tm4ckIAANo+OrhyQgAAGIg6uHJCAABW0Tq4ckIAAJQaO7hyQgAA0mM7uHJCAAAQrTu4ckIAAE72O7hyQgAAjD88uHJCAADKiDy4ckIAAAjSPLhyQgAARhs9uHJCAACEZD24ckIAAMKtPbhyQgAAAPc9uHJCAAA+QD64ckIAAHyJPrhyQgAAutI+uHJCAAD4Gz+4ckIAADZlP7hyQgAAdK4/uHJC\",\"dtype\":\"float64\",\"shape\":[288]},\"y\":[143,147,150,152,152,152,154,155,142,140,138,134,131,130,128,127,126,126,126,126,127,129,131,132,134,136,136,136,136,135,134,132,130,130,130,129,128,127,125,124,123,123,122,121,120,118,115,112,111,111,110,110,109,108,107,107,107,108,107,105,105,105,105,104,103,102,99,97,96,94,94,93,93,92,91,92,94,95,96,97,99,102,104,112,112,112,111,110,107,104,105,105,103,99,96,94,95,102,114,128,144,160,173,185,196,205,209,214,219,226,234,241,248,255,260,265,268,270,272,271,271,268,265,261,256,253,250,246,244,241,237,233,229,225,222,204,200,197,193,190,186,182,179,175,171,168,164,158,154,151,148,145,141,133,139,152,173,196,217,233,244,249,250,253,256,260,263,265,265,264,260,254,246,234,217,200,188,181,175,169,164,159,154,147,138,132,129,127,123,117,111,106,104,103,100,94,88,83,78,75,73,71,69,68,67,67,68,70,71,71,70,69,68,67,67,67,66,67,69,71,74,76,78,80,80,80,80,80,80,82,84,87,90,92,87,87,86,86,86,86,87,87,87,85,83,82,83,87,95,107,118,130,141,149,172,179,187,201,214,221,225,230,232,230,223,216,208,199,191,185,181,177,176,177,176,173,171,169,163,154,152,153,154,154,153,151,150,150]}},\"id\":\"28def88c-b97d-4f40-b823-9d7a945d1cd9\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"621ecd57-f0ee-4419-b870-ba77564aabb2\",\"type\":\"PanTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"18fde616-3db6-403c-b513-75ae7c95f923\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"8e0eb1d8-b2ab-41ca-a690-70f0bb106f2a\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"18fde616-3db6-403c-b513-75ae7c95f923\",\"type\":\"BoxAnnotation\"}},\"id\":\"53aa3d57-bdc4-4acf-b003-4a4e813d1249\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"0fe0b178-aa83-43f0-b5df-be0e90fc3c5c\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"196f5129-1f45-4ee8-9df2-7fedd9c2bc9c\",\"type\":\"ResetTool\"},{\"attributes\":{\"below\":[{\"id\":\"c5f5bd4b-c796-4870-8934-57054f4320dd\",\"type\":\"DatetimeAxis\"}],\"left\":[{\"id\":\"3df9485c-420e-4508-8fbe-43dc0d114d7c\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"renderers\":[{\"id\":\"c5f5bd4b-c796-4870-8934-57054f4320dd\",\"type\":\"DatetimeAxis\"},{\"id\":\"2910be48-08e9-40ff-819c-34ad69a5499b\",\"type\":\"Grid\"},{\"id\":\"3df9485c-420e-4508-8fbe-43dc0d114d7c\",\"type\":\"LinearAxis\"},{\"id\":\"1cc6d744-9250-4ac7-9188-0ca8197f3cbf\",\"type\":\"Grid\"},{\"id\":\"18fde616-3db6-403c-b513-75ae7c95f923\",\"type\":\"BoxAnnotation\"},{\"id\":\"59eac99a-76cf-44a6-836d-8ccd91dfe5da\",\"type\":\"GlyphRenderer\"},{\"id\":\"fee370a5-749f-4eb1-ab40-5d5974709954\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"50707447-05c4-45c9-8188-92e123e52a3f\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"19938f03-b40c-4183-8976-9ff6b8b14ecb\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"db652e83-ce49-44e7-9a44-3b5caf349dd5\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"ba8359e6-78e6-4aac-960d-274e03f41030\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"43b5a1d3-22d5-4258-8159-429d4773ccc1\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"ef522d68-870b-48de-aeee-c35c577fce6c\",\"type\":\"LinearScale\"}},\"id\":\"3ab305a4-66e6-4080-b59d-5cbe3d1aef5f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"0727e7c3-2960-4376-bde9-e4494df84eda\",\"type\":\"HelpTool\"},{\"attributes\":{\"mantissas\":[1,2,5],\"max_interval\":500.0,\"num_minor_ticks\":0},\"id\":\"ac99ac26-f5b5-4032-b6b1-4f2cdad691d5\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"base\":24,\"mantissas\":[1,2,4,6,8,12],\"max_interval\":43200000.0,\"min_interval\":3600000.0,\"num_minor_ticks\":0},\"id\":\"e37c4fba-cafc-4a4e-8f64-7f6224aaa183\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"days\":[1,4,7,10,13,16,19,22,25,28]},\"id\":\"0079f07a-2009-4e48-877a-21f4bc499698\",\"type\":\"DaysTicker\"},{\"attributes\":{\"days\":[1,8,15,22]},\"id\":\"dd0bbb54-6dd9-44dd-bcd0-403d70819d27\",\"type\":\"DaysTicker\"},{\"attributes\":{\"base\":60,\"mantissas\":[1,2,5,10,15,20,30],\"max_interval\":1800000.0,\"min_interval\":1000.0,\"num_minor_ticks\":0},\"id\":\"4b64f7e9-0950-41af-aa9c-c6df4e351737\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"days\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]},\"id\":\"12304ea0-ae21-475c-b08f-5a31b67ba13c\",\"type\":\"DaysTicker\"},{\"attributes\":{\"days\":[1,15]},\"id\":\"a916410c-7b2a-49b8-81d0-7abca99975c9\",\"type\":\"DaysTicker\"},{\"attributes\":{\"months\":[0,1,2,3,4,5,6,7,8,9,10,11]},\"id\":\"771e05a5-e856-440f-a2bc-a4480ee7b56e\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"621ecd57-f0ee-4419-b870-ba77564aabb2\",\"type\":\"PanTool\"},{\"id\":\"8e0eb1d8-b2ab-41ca-a690-70f0bb106f2a\",\"type\":\"WheelZoomTool\"},{\"id\":\"53aa3d57-bdc4-4acf-b003-4a4e813d1249\",\"type\":\"BoxZoomTool\"},{\"id\":\"0fe0b178-aa83-43f0-b5df-be0e90fc3c5c\",\"type\":\"SaveTool\"},{\"id\":\"196f5129-1f45-4ee8-9df2-7fedd9c2bc9c\",\"type\":\"ResetTool\"},{\"id\":\"0727e7c3-2960-4376-bde9-e4494df84eda\",\"type\":\"HelpTool\"},{\"id\":\"8a905c35-aef4-419d-9cdb-abc96178c0cd\",\"type\":\"HoverTool\"}]},\"id\":\"19938f03-b40c-4183-8976-9ff6b8b14ecb\",\"type\":\"Toolbar\"},{\"attributes\":{\"months\":[0,2,4,6,8,10]},\"id\":\"e67afaf7-537d-473c-aee6-dff593c23f98\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"db652e83-ce49-44e7-9a44-3b5caf349dd5\",\"type\":\"DataRange1d\"},{\"attributes\":{\"months\":[0,4,8]},\"id\":\"a09b33cf-da96-46fe-a3fc-09d6ce52ee2f\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"plot\":null,\"text\":\"Hover over points\"},\"id\":\"50707447-05c4-45c9-8188-92e123e52a3f\",\"type\":\"Title\"},{\"attributes\":{\"months\":[0,6]},\"id\":\"5d38a036-ad3f-41e2-abf6-ea7bdab58313\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[4,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"90578370-27cf-4b0f-9655-86f7bf58ea6f\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"c4cad2e6-e1f8-413c-be62-e067dcb7ef4a\",\"type\":\"YearsTicker\"},{\"attributes\":{},\"id\":\"ba8359e6-78e6-4aac-960d-274e03f41030\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null,\"mode\":\"hline\",\"renderers\":[{\"id\":\"fee370a5-749f-4eb1-ab40-5d5974709954\",\"type\":\"GlyphRenderer\"}],\"tooltips\":null},\"id\":\"8a905c35-aef4-419d-9cdb-abc96178c0cd\",\"type\":\"HoverTool\"},{\"attributes\":{\"callback\":null},\"id\":\"43b5a1d3-22d5-4258-8159-429d4773ccc1\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"line_dash\":[4,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8fea64e4-4463-4b3d-8937-5774335ebe4a\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.05},\"fill_color\":{\"value\":\"grey\"},\"line_color\":{\"value\":null},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"eb3c3203-62cb-41b6-8ae9-31f91316474a\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"ef522d68-870b-48de-aeee-c35c577fce6c\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a3ff8cbf-3b9b-4353-b780-94d45e7788b5\",\"type\":\"Circle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.3},\"fill_color\":{\"value\":\"firebrick\"},\"line_alpha\":{\"value\":0.3},\"line_color\":{\"value\":\"white\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8a6dab37-e38e-41ce-ad6b-a7b572ea2f27\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"28def88c-b97d-4f40-b823-9d7a945d1cd9\",\"type\":\"ColumnDataSource\"}},\"id\":\"3d2f896a-c3c5-4038-89de-551577407570\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1e277ee6-5af6-4f51-ad25-22dd9d308986\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"eb3c3203-62cb-41b6-8ae9-31f91316474a\",\"type\":\"Circle\"},\"hover_glyph\":{\"id\":\"8a6dab37-e38e-41ce-ad6b-a7b572ea2f27\",\"type\":\"Circle\"},\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"a3ff8cbf-3b9b-4353-b780-94d45e7788b5\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1d73a390-aa82-4182-931b-4442b218b0cd\",\"type\":\"CDSView\"}},\"id\":\"fee370a5-749f-4eb1-ab40-5d5974709954\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"num_minor_ticks\":5,\"tickers\":[{\"id\":\"ac99ac26-f5b5-4032-b6b1-4f2cdad691d5\",\"type\":\"AdaptiveTicker\"},{\"id\":\"4b64f7e9-0950-41af-aa9c-c6df4e351737\",\"type\":\"AdaptiveTicker\"},{\"id\":\"e37c4fba-cafc-4a4e-8f64-7f6224aaa183\",\"type\":\"AdaptiveTicker\"},{\"id\":\"12304ea0-ae21-475c-b08f-5a31b67ba13c\",\"type\":\"DaysTicker\"},{\"id\":\"0079f07a-2009-4e48-877a-21f4bc499698\",\"type\":\"DaysTicker\"},{\"id\":\"dd0bbb54-6dd9-44dd-bcd0-403d70819d27\",\"type\":\"DaysTicker\"},{\"id\":\"a916410c-7b2a-49b8-81d0-7abca99975c9\",\"type\":\"DaysTicker\"},{\"id\":\"771e05a5-e856-440f-a2bc-a4480ee7b56e\",\"type\":\"MonthsTicker\"},{\"id\":\"e67afaf7-537d-473c-aee6-dff593c23f98\",\"type\":\"MonthsTicker\"},{\"id\":\"a09b33cf-da96-46fe-a3fc-09d6ce52ee2f\",\"type\":\"MonthsTicker\"},{\"id\":\"5d38a036-ad3f-41e2-abf6-ea7bdab58313\",\"type\":\"MonthsTicker\"},{\"id\":\"c4cad2e6-e1f8-413c-be62-e067dcb7ef4a\",\"type\":\"YearsTicker\"}]},\"id\":\"0037ba3c-8c1a-49e4-936b-f24343aea3ae\",\"type\":\"DatetimeTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"e5bc7c32-77c2-4dcf-b19c-a522925e646b\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"3ab305a4-66e6-4080-b59d-5cbe3d1aef5f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"9a5827c7-d820-419b-9a0f-81928ccdee57\",\"type\":\"BasicTicker\"}},\"id\":\"3df9485c-420e-4508-8fbe-43dc0d114d7c\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"3ab305a4-66e6-4080-b59d-5cbe3d1aef5f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0037ba3c-8c1a-49e4-936b-f24343aea3ae\",\"type\":\"DatetimeTicker\"}},\"id\":\"2910be48-08e9-40ff-819c-34ad69a5499b\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"1e277ee6-5af6-4f51-ad25-22dd9d308986\",\"type\":\"ColumnDataSource\"}},\"id\":\"1d73a390-aa82-4182-931b-4442b218b0cd\",\"type\":\"CDSView\"},{\"attributes\":{\"formatter\":{\"id\":\"b261bf6f-7046-4da8-a87c-8076ba83d142\",\"type\":\"DatetimeTickFormatter\"},\"plot\":{\"id\":\"3ab305a4-66e6-4080-b59d-5cbe3d1aef5f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0037ba3c-8c1a-49e4-936b-f24343aea3ae\",\"type\":\"DatetimeTicker\"}},\"id\":\"c5f5bd4b-c796-4870-8934-57054f4320dd\",\"type\":\"DatetimeAxis\"},{\"attributes\":{},\"id\":\"9a5827c7-d820-419b-9a0f-81928ccdee57\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"3ab305a4-66e6-4080-b59d-5cbe3d1aef5f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"9a5827c7-d820-419b-9a0f-81928ccdee57\",\"type\":\"BasicTicker\"}},\"id\":\"1cc6d744-9250-4ac7-9188-0ca8197f3cbf\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"28def88c-b97d-4f40-b823-9d7a945d1cd9\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8fea64e4-4463-4b3d-8937-5774335ebe4a\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"90578370-27cf-4b0f-9655-86f7bf58ea6f\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"3d2f896a-c3c5-4038-89de-551577407570\",\"type\":\"CDSView\"}},\"id\":\"59eac99a-76cf-44a6-836d-8ccd91dfe5da\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"e5bc7c32-77c2-4dcf-b19c-a522925e646b\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":{\"__ndarray__\":\"AADyke23ckIAADDb7bdyQgAAbiTut3JCAACsbe63ckIAAOq27rdyQgAAKADvt3JCAABmSe+3ckIAAKSS77dyQgAA4tvvt3JCAAAgJfC3ckIAAF5u8LdyQgAAnLfwt3JCAADaAPG3ckIAABhK8bdyQgAAVpPxt3JCAACU3PG3ckIAANIl8rdyQgAAEG/yt3JCAABOuPK3ckIAAIwB87dyQgAAykrzt3JCAAAIlPO3ckIAAEbd87dyQgAAhCb0t3JCAADCb/S3ckIAAAC59LdyQgAAPgL1t3JCAAB8S/W3ckIAALqU9bdyQgAA+N31t3JCAAA2J/a3ckIAAHRw9rdyQgAAsrn2t3JCAADwAve3ckIAAC5M97dyQgAAbJX3t3JCAACq3ve3ckIAAOgn+LdyQgAAJnH4t3JCAABkuvi3ckIAAKID+bdyQgAA4Ez5t3JCAAAelvm3ckIAAFzf+bdyQgAAmij6t3JCAADYcfq3ckIAABa7+rdyQgAAVAT7t3JCAACSTfu3ckIAANCW+7dyQgAADuD7t3JCAABMKfy3ckIAAIpy/LdyQgAAyLv8t3JCAAAGBf23ckIAAERO/bdyQgAAgpf9t3JCAADA4P23ckIAAP4p/rdyQgAAPHP+t3JCAAB6vP63ckIAALgF/7dyQgAA9k7/t3JCAAA0mP+3ckIAAHLh/7dyQgAAsCoAuHJCAADucwC4ckIAACy9ALhyQgAAagYBuHJCAACoTwG4ckIAAOaYAbhyQgAAJOIBuHJCAABiKwK4ckIAAKB0ArhyQgAA3r0CuHJCAAAcBwO4ckIAAFpQA7hyQgAAmJkDuHJCAADW4gO4ckIAABQsBLhyQgAAUnUEuHJCAACQvgS4ckIAAM4HBbhyQgAADFEFuHJCAABKmgW4ckIAAIjjBbhyQgAAxiwGuHJCAAAEdga4ckIAAEK/BrhyQgAAgAgHuHJCAAC+UQe4ckIAAPyaB7hyQgAAOuQHuHJCAAB4LQi4ckIAALZ2CLhyQgAA9L8IuHJCAAAyCQm4ckIAAHBSCbhyQgAArpsJuHJCAADs5Am4ckIAACouCrhyQgAAaHcKuHJCAACmwAq4ckIAAOQJC7hyQgAAIlMLuHJCAABgnAu4ckIAAJ7lC7hyQgAA3C4MuHJCAAAaeAy4ckIAAFjBDLhyQgAAlgoNuHJCAADUUw24ckIAABKdDbhyQgAAUOYNuHJCAACOLw64ckIAAMx4DrhyQgAACsIOuHJCAABICw+4ckIAAIZUD7hyQgAAxJ0PuHJCAAAC5w+4ckIAAEAwELhyQgAAfnkQuHJCAAC8whC4ckIAAPoLEbhyQgAAOFURuHJCAAB2nhG4ckIAALTnEbhyQgAA8jASuHJCAAAwehK4ckIAAG7DErhyQgAArAwTuHJCAADqVRO4ckIAACifE7hyQgAAZugTuHJCAACkMRS4ckIAAOJ6FLhyQgAAIMQUuHJCAABeDRW4ckIAAJxWFbhyQgAA2p8VuHJCAAAY6RW4ckIAAFYyFrhyQgAAlHsWuHJCAADSxBa4ckIAABAOF7hyQgAATlcXuHJCAACMoBe4ckIAAMrpF7hyQgAACDMYuHJCAABGfBi4ckIAAITFGLhyQgAAwg4ZuHJCAAAAWBm4ckIAAD6hGbhyQgAAfOoZuHJCAAC6Mxq4ckIAAPh8GrhyQgAANsYauHJCAAB0Dxu4ckIAALJYG7hyQgAA8KEbuHJCAAAu6xu4ckIAAGw0HLhyQgAAqn0cuHJCAADoxhy4ckIAACYQHbhyQgAAZFkduHJCAACioh24ckIAAODrHbhyQgAAHjUeuHJCAABcfh64ckIAAJrHHrhyQgAA2BAfuHJCAAAWWh+4ckIAAFSjH7hyQgAAkuwfuHJCAADQNSC4ckIAAA5/ILhyQgAATMgguHJCAACKESG4ckIAAMhaIbhyQgAABqQhuHJCAABE7SG4ckIAAII2IrhyQgAAwH8iuHJCAAD+yCK4ckIAADwSI7hyQgAAelsjuHJCAAC4pCO4ckIAAPbtI7hyQgAANDckuHJCAABygCS4ckIAALDJJLhyQgAA7hIluHJCAAAsXCW4ckIAAGqlJbhyQgAAqO4luHJCAADmNya4ckIAACSBJrhyQgAAYsomuHJCAACgEye4ckIAAN5cJ7hyQgAAHKYnuHJCAABa7ye4ckIAAJg4KLhyQgAA1oEouHJCAAAUyyi4ckIAAFIUKbhyQgAAkF0puHJCAADOpim4ckIAAAzwKbhyQgAASjkquHJCAACIgiq4ckIAAMbLKrhyQgAABBUruHJCAABCXiu4ckIAAICnK7hyQgAAvvAruHJCAAD8OSy4ckIAADqDLLhyQgAAeMwsuHJCAAC2FS24ckIAAPReLbhyQgAAMqgtuHJCAABw8S24ckIAAK46LrhyQgAA7IMuuHJCAAAqzS64ckIAAGgWL7hyQgAApl8vuHJCAADkqC+4ckIAACLyL7hyQgAAYDswuHJCAACehDC4ckIAANzNMLhyQgAAGhcxuHJCAABYYDG4ckIAAJapMbhyQgAA1PIxuHJCAAASPDK4ckIAAFCFMrhyQgAAjs4yuHJCAADMFzO4ckIAAAphM7hyQgAASKozuHJCAACG8zO4ckIAAMQ8NLhyQgAAAoY0uHJCAABAzzS4ckIAAH4YNbhyQgAAvGE1uHJCAAD6qjW4ckIAADj0NbhyQgAAdj02uHJCAAC0hja4ckIAAPLPNrhyQgAAMBk3uHJCAABuYje4ckIAAKyrN7hyQgAA6vQ3uHJCAAAoPji4ckIAAGaHOLhyQgAApNA4uHJCAADiGTm4ckIAACBjObhyQgAAXqw5uHJCAACc9Tm4ckIAANo+OrhyQgAAGIg6uHJCAABW0Tq4ckIAAJQaO7hyQgAA0mM7uHJCAAAQrTu4ckIAAE72O7hyQgAAjD88uHJCAADKiDy4ckIAAAjSPLhyQgAARhs9uHJCAACEZD24ckIAAMKtPbhyQgAAAPc9uHJCAAA+QD64ckIAAHyJPrhyQgAAutI+uHJCAAD4Gz+4ckIAADZlP7hyQgAAdK4/uHJC\",\"dtype\":\"float64\",\"shape\":[288]},\"y\":[143,147,150,152,152,152,154,155,142,140,138,134,131,130,128,127,126,126,126,126,127,129,131,132,134,136,136,136,136,135,134,132,130,130,130,129,128,127,125,124,123,123,122,121,120,118,115,112,111,111,110,110,109,108,107,107,107,108,107,105,105,105,105,104,103,102,99,97,96,94,94,93,93,92,91,92,94,95,96,97,99,102,104,112,112,112,111,110,107,104,105,105,103,99,96,94,95,102,114,128,144,160,173,185,196,205,209,214,219,226,234,241,248,255,260,265,268,270,272,271,271,268,265,261,256,253,250,246,244,241,237,233,229,225,222,204,200,197,193,190,186,182,179,175,171,168,164,158,154,151,148,145,141,133,139,152,173,196,217,233,244,249,250,253,256,260,263,265,265,264,260,254,246,234,217,200,188,181,175,169,164,159,154,147,138,132,129,127,123,117,111,106,104,103,100,94,88,83,78,75,73,71,69,68,67,67,68,70,71,71,70,69,68,67,67,67,66,67,69,71,74,76,78,80,80,80,80,80,80,82,84,87,90,92,87,87,86,86,86,86,87,87,87,85,83,82,83,87,95,107,118,130,141,149,172,179,187,201,214,221,225,230,232,230,223,216,208,199,191,185,181,177,176,177,176,173,171,169,163,154,152,153,154,154,153,151,150,150]}},\"id\":\"1e277ee6-5af6-4f51-ad25-22dd9d308986\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"b261bf6f-7046-4da8-a87c-8076ba83d142\",\"type\":\"DatetimeTickFormatter\"}],\"root_ids\":[\"3ab305a4-66e6-4080-b59d-5cbe3d1aef5f\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"b6e9e80a-9145-433b-8744-df6c961c8313\",\"elementid\":\"61edb807-1130-481f-ac6e-863f4b970eb0\",\"modelid\":\"3ab305a4-66e6-4080-b59d-5cbe3d1aef5f\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "3ab305a4-66e6-4080-b59d-5cbe3d1aef5f"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models.tools import HoverTool\n",
    "from bokeh.sampledata.glucose import data\n",
    "\n",
    "subset = data.loc['2010-10-06']\n",
    "\n",
    "x, y = subset.index.to_series(), subset['glucose']\n",
    "\n",
    "# Basic plot setup\n",
    "p = figure(width=600, height=300, x_axis_type=\"datetime\", title='Hover over points')\n",
    "\n",
    "p.line(x, y, line_dash=\"4 4\", line_width=1, color='gray')\n",
    "\n",
    "cr = p.circle(x, y, size=20,\n",
    "              fill_color=\"grey\", hover_fill_color=\"firebrick\",\n",
    "              fill_alpha=0.05, hover_alpha=0.3,\n",
    "              line_color=None, hover_line_color=\"white\")\n",
    "\n",
    "p.add_tools(HoverTool(tooltips=None, renderers=[cr], mode='hline'))\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE: experiment with standard, selected, hover glyph visual properties\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Axes（轴）\n",
    "\n",
    "[Axes](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#axes)\n",
    "\n",
    "要指定Axis的视觉样式，你首先必须找到`Axis`对象。最简单的方法是使用`Plot`的一些便利方法：[axis](http://bokeh.pydata.org/en/latest/docs/reference/plotting.html#bokeh.plotting.Figure.axis), [xaxis](http://bokeh.pydata.org/en/latest/docs/reference/plotting.html#bokeh.plotting.Figure.xaxis), [yaxis](http://bokeh.pydata.org/en/latest/docs/reference/plotting.html#bokeh.plotting.Figure.yaxis)。这些方法返回轴对象的列表：\n",
    "\n",
    "```\n",
    ">>> p.xaxis\n",
    "[<bokeh.models.axes.LinearAxis at 0x106fa2390>]\n",
    "```\n",
    "但是，您可以设置列表中所有元素的属性，就像它是一个对象一样：\n",
    "```\n",
    "p.xaxis.axis_label = \"Temperature\"\n",
    "p.axis.major_label_text_color = \"orange\"\n",
    "```\n",
    "这些被称为“splattable”列表，以及它们的tab补全。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE Try out tab completion. Type p.xaxis.<press tab key> to see a list of attributes that can be set.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* **axis** \n",
    " - [line properties](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#line-properties)\n",
    "* **axis_label** \n",
    " - [text properties](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#text-properties)\n",
    " - ``axis_label_standoff``\n",
    "* **major_label** \n",
    " - [text properties](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#text-properties)\n",
    " - ``orientation``\n",
    "* **major_tick** \n",
    " - [line_properties](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#line-properties)\n",
    " - ``major_tick_in`` \n",
    " - ``major_tick_out``\n",
    "* **minor_tick** \n",
    " - [line properties](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#line-properties)\n",
    " - ``minor_tick_in``\n",
    " - ``minor_tick_out``\n",
    "\n",
    "作为第一个简单例子，让我们改变一个图的两个轴上主要刻度标记的方向："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"8712acb5-2129-47e8-a7e5-1714ce1dfebc\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"b48f6872-6cc3-4bb8-aeca-7dc04d3be191\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"0db522d8-dcdc-4be0-8fba-c29a93ea7a67\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"45a3f39c-5614-4ccb-a9af-f5f77d56665e\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"fc2e9ffd-4c34-4d7e-9fe9-9aeb7e0719fa\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"79f4b974-4fba-46b6-98be-5c6cac40988d\",\"type\":\"X\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"a8fe9a41-6282-4957-bb34-67a3cca044fb\",\"type\":\"X\"},\"selection_glyph\":null,\"view\":{\"id\":\"3cb5999b-7ffa-46d1-acaf-d912e404b5af\",\"type\":\"CDSView\"}},\"id\":\"ad508395-5ba2-410a-83ae-4f8ce749af45\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"d71a2603-aa1f-4e11-9c9e-3fd8835e9a9e\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"79f4b974-4fba-46b6-98be-5c6cac40988d\",\"type\":\"X\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"6005538c-4e3a-43fd-9896-69ec1367e669\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"de0a2c21-a9ad-45b3-a9d2-224faaa77b5e\",\"type\":\"BasicTicker\"}},\"id\":\"0faa4b18-f3a4-4320-84a0-00b16d58c79d\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"362a64b4-6217-4b65-ae9c-75ddace5be88\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"6005538c-4e3a-43fd-9896-69ec1367e669\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"cba5a126-84e7-4265-94f7-3c6d601e1df6\",\"type\":\"BasicTicker\"}},\"id\":\"e8b252ea-fedf-47ae-8a67-4af17301c2c8\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"cba5a126-84e7-4265-94f7-3c6d601e1df6\",\"type\":\"BasicTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"70c09615-8cd2-4697-9927-47fea015eda4\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"ced8731e-533f-44ea-958d-c89ac02f29ab\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a8fe9a41-6282-4957-bb34-67a3cca044fb\",\"type\":\"X\"},{\"attributes\":{\"formatter\":{\"id\":\"56d25f98-fe6e-465b-9883-cabe9b6403a8\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":\"vertical\",\"plot\":{\"id\":\"6005538c-4e3a-43fd-9896-69ec1367e669\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"de0a2c21-a9ad-45b3-a9d2-224faaa77b5e\",\"type\":\"BasicTicker\"}},\"id\":\"b350085e-71c2-44d2-918f-17bcee786bb4\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2b5dd856-429d-4b15-bc34-9e34c571ef95\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"b8508c37-327f-4b0d-8181-29e460d9dac4\",\"type\":\"HelpTool\"},{\"attributes\":{\"source\":{\"id\":\"fc2e9ffd-4c34-4d7e-9fe9-9aeb7e0719fa\",\"type\":\"ColumnDataSource\"}},\"id\":\"3cb5999b-7ffa-46d1-acaf-d912e404b5af\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"de0a2c21-a9ad-45b3-a9d2-224faaa77b5e\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"362a64b4-6217-4b65-ae9c-75ddace5be88\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"a8c5ea7e-7866-4211-b373-0a55ddba6ab6\",\"type\":\"Title\"},{\"attributes\":{\"below\":[{\"id\":\"e8b252ea-fedf-47ae-8a67-4af17301c2c8\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"b350085e-71c2-44d2-918f-17bcee786bb4\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"e8b252ea-fedf-47ae-8a67-4af17301c2c8\",\"type\":\"LinearAxis\"},{\"id\":\"065ff33a-e1b6-40dd-afb5-3a1707cd22fe\",\"type\":\"Grid\"},{\"id\":\"b350085e-71c2-44d2-918f-17bcee786bb4\",\"type\":\"LinearAxis\"},{\"id\":\"0faa4b18-f3a4-4320-84a0-00b16d58c79d\",\"type\":\"Grid\"},{\"id\":\"70c09615-8cd2-4697-9927-47fea015eda4\",\"type\":\"BoxAnnotation\"},{\"id\":\"ad508395-5ba2-410a-83ae-4f8ce749af45\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"a8c5ea7e-7866-4211-b373-0a55ddba6ab6\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"3422cce8-f6c9-4440-925a-754cce293fbd\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"0982562f-9c9c-483c-b171-b61a59eb9944\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"0db522d8-dcdc-4be0-8fba-c29a93ea7a67\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"d71a2603-aa1f-4e11-9c9e-3fd8835e9a9e\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"45a3f39c-5614-4ccb-a9af-f5f77d56665e\",\"type\":\"LinearScale\"}},\"id\":\"6005538c-4e3a-43fd-9896-69ec1367e669\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"plot\":{\"id\":\"6005538c-4e3a-43fd-9896-69ec1367e669\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"cba5a126-84e7-4265-94f7-3c6d601e1df6\",\"type\":\"BasicTicker\"}},\"id\":\"065ff33a-e1b6-40dd-afb5-3a1707cd22fe\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"70c09615-8cd2-4697-9927-47fea015eda4\",\"type\":\"BoxAnnotation\"}},\"id\":\"3bbc904d-8d2d-4deb-add3-a815e2eeac24\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"fc2e9ffd-4c34-4d7e-9fe9-9aeb7e0719fa\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"52cb15e1-e6b2-4012-9cd3-4577f53991c4\",\"type\":\"PanTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"52cb15e1-e6b2-4012-9cd3-4577f53991c4\",\"type\":\"PanTool\"},{\"id\":\"3cc0f4f9-6c13-4aa2-b65e-1dd3b8d1f106\",\"type\":\"WheelZoomTool\"},{\"id\":\"3bbc904d-8d2d-4deb-add3-a815e2eeac24\",\"type\":\"BoxZoomTool\"},{\"id\":\"2b5dd856-429d-4b15-bc34-9e34c571ef95\",\"type\":\"SaveTool\"},{\"id\":\"ced8731e-533f-44ea-958d-c89ac02f29ab\",\"type\":\"ResetTool\"},{\"id\":\"b8508c37-327f-4b0d-8181-29e460d9dac4\",\"type\":\"HelpTool\"}]},\"id\":\"3422cce8-f6c9-4440-925a-754cce293fbd\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"3cc0f4f9-6c13-4aa2-b65e-1dd3b8d1f106\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"0982562f-9c9c-483c-b171-b61a59eb9944\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"56d25f98-fe6e-465b-9883-cabe9b6403a8\",\"type\":\"BasicTickFormatter\"}],\"root_ids\":[\"6005538c-4e3a-43fd-9896-69ec1367e669\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"b48f6872-6cc3-4bb8-aeca-7dc04d3be191\",\"elementid\":\"8712acb5-2129-47e8-a7e5-1714ce1dfebc\",\"modelid\":\"6005538c-4e3a-43fd-9896-69ec1367e669\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "6005538c-4e3a-43fd-9896-69ec1367e669"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "p = figure(plot_width=400, plot_height=400)\n",
    "p.x([1,2,3,4,5], [2,5,8,2,7], size=10, line_width=2)\n",
    "\n",
    "p.xaxis.major_label_orientation = pi/4\n",
    "p.yaxis.major_label_orientation = \"vertical\"\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下面的例子则展示对几个不同轴属性进行定制："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"dae56327-0b48-4c69-8538-180882ddb671\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"28e97bb8-20fd-44e5-ad56-91c47f2cafd9\":{\"roots\":{\"references\":[{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"f4915999-33c2-4518-91dc-9509067f7a41\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"87f64fcb-1b1d-4138-9b9b-14115ff4b149\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"e70ca404-6ad9-4186-9eef-f73f136acdf0\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"e128df13-666a-4272-8142-2f26d9d095c7\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"273b120b-1b49-41a1-a064-a8ed0175e82a\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"7289398f-c8d2-49f1-842a-14e08907a40d\",\"type\":\"BasicTicker\"},{\"attributes\":{\"overlay\":{\"id\":\"f4915999-33c2-4518-91dc-9509067f7a41\",\"type\":\"BoxAnnotation\"}},\"id\":\"02ad27c0-d533-424e-86c7-f9070f1941f4\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"13664f50-d27d-4d9b-a791-c310df4a2009\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7289398f-c8d2-49f1-842a-14e08907a40d\",\"type\":\"BasicTicker\"}},\"id\":\"b6296bc9-f407-4e4e-831c-dca359f500f4\",\"type\":\"Grid\"},{\"attributes\":{\"plot\":{\"id\":\"13664f50-d27d-4d9b-a791-c310df4a2009\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e70ca404-6ad9-4186-9eef-f73f136acdf0\",\"type\":\"BasicTicker\"}},\"id\":\"cabbc437-eb29-4c7d-8c3a-10aaf36a5a55\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"98d5b6b7-d532-4364-8fe6-eb3ff5d4eb97\",\"type\":\"ColumnDataSource\"}},\"id\":\"570bac0f-7a86-427b-8b7d-23a24ba2e900\",\"type\":\"CDSView\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1d41aa74-4f7a-4d91-afeb-319847906303\",\"type\":\"PanTool\"},{\"id\":\"9bc26fb9-cf02-4aef-8484-5ecb1d16b7e7\",\"type\":\"WheelZoomTool\"},{\"id\":\"02ad27c0-d533-424e-86c7-f9070f1941f4\",\"type\":\"BoxZoomTool\"},{\"id\":\"483d5887-19aa-499e-bda4-c251356c543f\",\"type\":\"SaveTool\"},{\"id\":\"87f64fcb-1b1d-4138-9b9b-14115ff4b149\",\"type\":\"ResetTool\"},{\"id\":\"82351a25-70a8-4f77-a723-20146c222b6e\",\"type\":\"HelpTool\"}]},\"id\":\"4726e7b3-2de4-4c10-8b49-6a85296a95e4\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"98d5b6b7-d532-4364-8fe6-eb3ff5d4eb97\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a77b121e-013c-429f-af7a-aff9531305c0\",\"type\":\"Asterisk\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"f24c54e4-7ad4-4dbb-a7c9-a56c0365d73a\",\"type\":\"Asterisk\"},\"selection_glyph\":null,\"view\":{\"id\":\"570bac0f-7a86-427b-8b7d-23a24ba2e900\",\"type\":\"CDSView\"}},\"id\":\"6f2b2b41-5730-49c9-8462-0e3862d0cede\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"98d5b6b7-d532-4364-8fe6-eb3ff5d4eb97\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":12},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"f24c54e4-7ad4-4dbb-a7c9-a56c0365d73a\",\"type\":\"Asterisk\"},{\"attributes\":{},\"id\":\"c1c25a49-785a-4200-9b2c-2fb96e221147\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"9bc26fb9-cf02-4aef-8484-5ecb1d16b7e7\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"271fd737-095e-4d54-a508-391df1b2defc\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis_label\":\"Pressure\",\"formatter\":{\"id\":\"e128df13-666a-4272-8142-2f26d9d095c7\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":\"vertical\",\"major_label_text_color\":{\"value\":\"orange\"},\"minor_tick_in\":-3,\"minor_tick_out\":6,\"plot\":{\"id\":\"13664f50-d27d-4d9b-a791-c310df4a2009\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7289398f-c8d2-49f1-842a-14e08907a40d\",\"type\":\"BasicTicker\"}},\"id\":\"524f0d04-eea5-4d99-b826-cd9572fbce4c\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"483d5887-19aa-499e-bda4-c251356c543f\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1d41aa74-4f7a-4d91-afeb-319847906303\",\"type\":\"PanTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"eb400681-836f-431d-a274-325f0d6ca811\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"82351a25-70a8-4f77-a723-20146c222b6e\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null},\"id\":\"4a856a66-22c8-4eb9-93fa-2f9b2149e958\",\"type\":\"DataRange1d\"},{\"attributes\":{\"below\":[{\"id\":\"a61b192d-8327-40bf-a20b-a3b3db713fb9\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"524f0d04-eea5-4d99-b826-cd9572fbce4c\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"a61b192d-8327-40bf-a20b-a3b3db713fb9\",\"type\":\"LinearAxis\"},{\"id\":\"cabbc437-eb29-4c7d-8c3a-10aaf36a5a55\",\"type\":\"Grid\"},{\"id\":\"524f0d04-eea5-4d99-b826-cd9572fbce4c\",\"type\":\"LinearAxis\"},{\"id\":\"b6296bc9-f407-4e4e-831c-dca359f500f4\",\"type\":\"Grid\"},{\"id\":\"f4915999-33c2-4518-91dc-9509067f7a41\",\"type\":\"BoxAnnotation\"},{\"id\":\"6f2b2b41-5730-49c9-8462-0e3862d0cede\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"eb400681-836f-431d-a274-325f0d6ca811\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"4726e7b3-2de4-4c10-8b49-6a85296a95e4\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"273b120b-1b49-41a1-a064-a8ed0175e82a\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"c1c25a49-785a-4200-9b2c-2fb96e221147\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"4a856a66-22c8-4eb9-93fa-2f9b2149e958\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"3306b9cb-8f02-4bd3-9f4a-fcbd6b3f97f8\",\"type\":\"LinearScale\"}},\"id\":\"13664f50-d27d-4d9b-a791-c310df4a2009\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"axis_label\":\"Temp\",\"axis_line_color\":{\"value\":\"red\"},\"axis_line_width\":{\"value\":3},\"formatter\":{\"id\":\"271fd737-095e-4d54-a508-391df1b2defc\",\"type\":\"BasicTickFormatter\"},\"minor_tick_in\":-3,\"minor_tick_out\":6,\"plot\":{\"id\":\"13664f50-d27d-4d9b-a791-c310df4a2009\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e70ca404-6ad9-4186-9eef-f73f136acdf0\",\"type\":\"BasicTicker\"}},\"id\":\"a61b192d-8327-40bf-a20b-a3b3db713fb9\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_color\":{\"value\":\"olive\"},\"line_color\":{\"value\":\"olive\"},\"size\":{\"units\":\"screen\",\"value\":12},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a77b121e-013c-429f-af7a-aff9531305c0\",\"type\":\"Asterisk\"},{\"attributes\":{},\"id\":\"3306b9cb-8f02-4bd3-9f4a-fcbd6b3f97f8\",\"type\":\"LinearScale\"}],\"root_ids\":[\"13664f50-d27d-4d9b-a791-c310df4a2009\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"28e97bb8-20fd-44e5-ad56-91c47f2cafd9\",\"elementid\":\"dae56327-0b48-4c69-8538-180882ddb671\",\"modelid\":\"13664f50-d27d-4d9b-a791-c310df4a2009\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "13664f50-d27d-4d9b-a791-c310df4a2009"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = figure(plot_width=400, plot_height=400)\n",
    "p.asterisk([1,2,3,4,5], [2,5,8,2,7], size=12, color=\"olive\")\n",
    "\n",
    "# change just some things about the x-axes\n",
    "p.xaxis.axis_label = \"Temp\"\n",
    "p.xaxis.axis_line_width = 3\n",
    "p.xaxis.axis_line_color = \"red\"\n",
    "\n",
    "# change just some things about the y-axes\n",
    "p.yaxis.axis_label = \"Pressure\"\n",
    "p.yaxis.major_label_text_color = \"orange\"\n",
    "p.yaxis.major_label_orientation = \"vertical\"\n",
    "\n",
    "# change things on all axes\n",
    "p.axis.minor_tick_in = -3\n",
    "p.axis.minor_tick_out = 6\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE Create a plot of your own and customize several axis properties\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "还可以进一步进行定制。请参见[用户指南](http://bokeh.pydata.org/en/latest/docs/user_guide.html)以获取更多关于诸如[标记格式设置](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#tick-label-formats)或[限制轴界](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#bounds)等主题的信息。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Grids（网格）\n",
    "\n",
    "[Grids](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#grids)\n",
    "\n",
    "* **grid** [line properties](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#line-properties)\n",
    "* **band** [fill properties]()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"02fd4e69-9898-411d-9369-acebf9b5f9d8\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"5fcfd33a-bd20-46aa-8124-add2cd051af9\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"b2a7c0fa-c05c-4f1b-b5fe-59ca19993f6e\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"8c1081ca-40ff-4652-bcc6-5ecc2c0ecf3e\",\"type\":\"HelpTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1e1e546d-715b-4674-9637-95045383b086\",\"type\":\"PanTool\"},{\"id\":\"9c59730d-43bb-46ec-b660-9c2ed44caf23\",\"type\":\"WheelZoomTool\"},{\"id\":\"fdfa68a6-2464-48bd-9472-d0d6e12401d0\",\"type\":\"BoxZoomTool\"},{\"id\":\"19492e4b-74f3-4c07-8f91-6360d82af320\",\"type\":\"SaveTool\"},{\"id\":\"b2a7c0fa-c05c-4f1b-b5fe-59ca19993f6e\",\"type\":\"ResetTool\"},{\"id\":\"8c1081ca-40ff-4652-bcc6-5ecc2c0ecf3e\",\"type\":\"HelpTool\"}]},\"id\":\"19faf567-3d0e-4a34-821c-738dcef4e33e\",\"type\":\"Toolbar\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"78b60b2b-2ac3-4541-883a-82dbd607ca1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"9df59435-b469-44fe-bd6f-bc50b0d9d6c6\",\"type\":\"BasicTicker\"}},\"id\":\"5c22b3f3-ed1c-4b91-92b9-8e6b2f9ff514\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"76712322-d6a7-43f8-803f-e375e6a3400b\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"26816c69-1250-44bd-8c63-c675aaf7e6ae\",\"type\":\"BasicTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"71d59a85-f778-4e03-9d97-54a233a56872\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"10e7b81f-e917-4ac2-a7b5-1040045c7323\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1e1e546d-715b-4674-9637-95045383b086\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"4af03a2f-e2b1-4578-9775-fa9762d6dccc\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"9c59730d-43bb-46ec-b660-9c2ed44caf23\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"001f955a-f153-49a5-93e7-7f57bab18dda\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"4af03a2f-e2b1-4578-9775-fa9762d6dccc\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"78b60b2b-2ac3-4541-883a-82dbd607ca1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"9df59435-b469-44fe-bd6f-bc50b0d9d6c6\",\"type\":\"BasicTicker\"}},\"id\":\"e417795e-9615-4665-ba0d-fa5fa970b374\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"c4971a73-a385-4fad-9e88-bd47c57d28ce\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"37718464-5f38-4c8e-84f5-a28aa3669f80\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"46f72bbf-7d0a-4b3b-8700-141cbcb94fa7\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"c4971a73-a385-4fad-9e88-bd47c57d28ce\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a5505f5e-f774-4138-876b-ad03d67914e4\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"76712322-d6a7-43f8-803f-e375e6a3400b\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"3b447e2a-80ad-4b48-8a5f-daef95df1550\",\"type\":\"CDSView\"}},\"id\":\"1438852a-3812-4b0f-bb77-35cddd968d7b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"dimension\":1,\"grid_line_alpha\":{\"value\":0.5},\"grid_line_dash\":[6,4],\"plot\":{\"id\":\"78b60b2b-2ac3-4541-883a-82dbd607ca1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"26816c69-1250-44bd-8c63-c675aaf7e6ae\",\"type\":\"BasicTicker\"}},\"id\":\"f30ecf71-2fa0-4f10-91b9-ddee961700c3\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"19492e4b-74f3-4c07-8f91-6360d82af320\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a5505f5e-f774-4138-876b-ad03d67914e4\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"c4971a73-a385-4fad-9e88-bd47c57d28ce\",\"type\":\"ColumnDataSource\"}},\"id\":\"3b447e2a-80ad-4b48-8a5f-daef95df1550\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"71d59a85-f778-4e03-9d97-54a233a56872\",\"type\":\"BoxAnnotation\"}},\"id\":\"fdfa68a6-2464-48bd-9472-d0d6e12401d0\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"9df59435-b469-44fe-bd6f-bc50b0d9d6c6\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"4a2387bd-d885-4126-ba61-1614bff66a58\",\"type\":\"DataRange1d\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"03265d98-aaab-483c-a36e-ad31444d2f6d\",\"type\":\"Title\"},{\"attributes\":{\"formatter\":{\"id\":\"10e7b81f-e917-4ac2-a7b5-1040045c7323\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"78b60b2b-2ac3-4541-883a-82dbd607ca1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"26816c69-1250-44bd-8c63-c675aaf7e6ae\",\"type\":\"BasicTicker\"}},\"id\":\"cc1943e5-0088-4dd0-a03d-9f0d76cd150f\",\"type\":\"LinearAxis\"},{\"attributes\":{\"below\":[{\"id\":\"e417795e-9615-4665-ba0d-fa5fa970b374\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"cc1943e5-0088-4dd0-a03d-9f0d76cd150f\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"e417795e-9615-4665-ba0d-fa5fa970b374\",\"type\":\"LinearAxis\"},{\"id\":\"5c22b3f3-ed1c-4b91-92b9-8e6b2f9ff514\",\"type\":\"Grid\"},{\"id\":\"cc1943e5-0088-4dd0-a03d-9f0d76cd150f\",\"type\":\"LinearAxis\"},{\"id\":\"f30ecf71-2fa0-4f10-91b9-ddee961700c3\",\"type\":\"Grid\"},{\"id\":\"71d59a85-f778-4e03-9d97-54a233a56872\",\"type\":\"BoxAnnotation\"},{\"id\":\"1438852a-3812-4b0f-bb77-35cddd968d7b\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"03265d98-aaab-483c-a36e-ad31444d2f6d\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"19faf567-3d0e-4a34-821c-738dcef4e33e\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"4a2387bd-d885-4126-ba61-1614bff66a58\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"46f72bbf-7d0a-4b3b-8700-141cbcb94fa7\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"001f955a-f153-49a5-93e7-7f57bab18dda\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"37718464-5f38-4c8e-84f5-a28aa3669f80\",\"type\":\"LinearScale\"}},\"id\":\"78b60b2b-2ac3-4541-883a-82dbd607ca1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"}],\"root_ids\":[\"78b60b2b-2ac3-4541-883a-82dbd607ca1c\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"5fcfd33a-bd20-46aa-8124-add2cd051af9\",\"elementid\":\"02fd4e69-9898-411d-9369-acebf9b5f9d8\",\"modelid\":\"78b60b2b-2ac3-4541-883a-82dbd607ca1c\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "78b60b2b-2ac3-4541-883a-82dbd607ca1c"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = figure(plot_width=400, plot_height=400)\n",
    "p.circle([1,2,3,4,5], [2,5,8,2,7], size=10)\n",
    "\n",
    "# change just some things about the x-grid\n",
    "p.xgrid.grid_line_color = None\n",
    "\n",
    "# change just some things about the y-grid\n",
    "p.ygrid.grid_line_alpha = 0.5\n",
    "p.ygrid.grid_line_dash = [6, 4]\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"2a078516-9ea0-427b-832d-840c898a2dbb\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"bac4355e-548c-433a-a629-80be9b8fa25f\":{\"roots\":{\"references\":[{\"attributes\":{\"formatter\":{\"id\":\"e7552735-9810-43f5-9127-923d6d114bb1\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5a808ba7-2c09-45e7-a11d-ef7c7b9e76e7\",\"type\":\"BasicTicker\"}},\"id\":\"0c4960f7-c26f-47a1-9daa-cf3170c329e2\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"75809305-9bd7-4c8f-a235-ce8d0fcd730e\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"3cb27ec5-0848-4e31-9c58-1e27b9645c6a\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e2b0017b-1124-40c5-a769-bfdc678b39bf\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"20e6cffb-92cf-4f9d-a3a3-9a3ab0cdd1f2\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"f8e23d70-99f3-4823-a6f9-8e989e2aa7d3\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2dcfab22-3dfd-40b9-92d8-4de44e2b9bd1\",\"type\":\"PanTool\"},{\"id\":\"40635976-20a9-4df8-b8ca-e950357eefa6\",\"type\":\"WheelZoomTool\"},{\"id\":\"1a6d16fa-1ebe-448b-93ff-48042b97a962\",\"type\":\"BoxZoomTool\"},{\"id\":\"aa1eae6e-3b16-4967-9108-bc21257bc638\",\"type\":\"SaveTool\"},{\"id\":\"b691f702-56d4-40f6-8fad-4242fdcfb6b1\",\"type\":\"ResetTool\"},{\"id\":\"20e6cffb-92cf-4f9d-a3a3-9a3ab0cdd1f2\",\"type\":\"HelpTool\"}]},\"id\":\"d399d611-8f0f-4ba7-a6e6-79ad7cd009de\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"780b91fb-2b10-4708-8622-93616a0f5d6a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ab9d5f93-e276-454b-9d69-e4ec125d2165\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"e2b0017b-1124-40c5-a769-bfdc678b39bf\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"fd3cf6bf-e2d8-4539-8d79-34a9e60e7cb9\",\"type\":\"CDSView\"}},\"id\":\"042429ca-32d5-4afc-a2ab-73d6fff34bdf\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"0ea6549b-4af4-44d4-8db7-37b0035f6e84\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"5e742522-9e5b-43c8-811e-aab1d60666cb\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"40635976-20a9-4df8-b8ca-e950357eefa6\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"aa1eae6e-3b16-4967-9108-bc21257bc638\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"ab9d5f93-e276-454b-9d69-e4ec125d2165\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"b691f702-56d4-40f6-8fad-4242fdcfb6b1\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5e742522-9e5b-43c8-811e-aab1d60666cb\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3cb27ec5-0848-4e31-9c58-1e27b9645c6a\",\"type\":\"BasicTicker\"}},\"id\":\"d89faa14-5e03-4ca9-837e-c000d5bd1183\",\"type\":\"LinearAxis\"},{\"attributes\":{\"overlay\":{\"id\":\"bd0c3ed7-4b3a-48e4-9cba-32c36d75b882\",\"type\":\"BoxAnnotation\"}},\"id\":\"1a6d16fa-1ebe-448b-93ff-48042b97a962\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"5a808ba7-2c09-45e7-a11d-ef7c7b9e76e7\",\"type\":\"BasicTicker\"},{\"attributes\":{\"band_fill_alpha\":{\"value\":0.1},\"band_fill_color\":{\"value\":\"navy\"},\"dimension\":1,\"plot\":{\"id\":\"ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3cb27ec5-0848-4e31-9c58-1e27b9645c6a\",\"type\":\"BasicTicker\"}},\"id\":\"c5c75404-0100-4417-b596-c23044aed6b9\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2dcfab22-3dfd-40b9-92d8-4de44e2b9bd1\",\"type\":\"PanTool\"},{\"attributes\":{\"below\":[{\"id\":\"0c4960f7-c26f-47a1-9daa-cf3170c329e2\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"d89faa14-5e03-4ca9-837e-c000d5bd1183\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"0c4960f7-c26f-47a1-9daa-cf3170c329e2\",\"type\":\"LinearAxis\"},{\"id\":\"1d54d1f3-b5c2-48e0-9e41-1266447489fb\",\"type\":\"Grid\"},{\"id\":\"d89faa14-5e03-4ca9-837e-c000d5bd1183\",\"type\":\"LinearAxis\"},{\"id\":\"c5c75404-0100-4417-b596-c23044aed6b9\",\"type\":\"Grid\"},{\"id\":\"bd0c3ed7-4b3a-48e4-9cba-32c36d75b882\",\"type\":\"BoxAnnotation\"},{\"id\":\"042429ca-32d5-4afc-a2ab-73d6fff34bdf\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"f8e23d70-99f3-4823-a6f9-8e989e2aa7d3\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"d399d611-8f0f-4ba7-a6e6-79ad7cd009de\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"0ea6549b-4af4-44d4-8db7-37b0035f6e84\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"75809305-9bd7-4c8f-a235-ce8d0fcd730e\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"4d0241a4-bb06-4a04-af9c-6e4aac22b366\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"8355bf3b-4562-4c1b-9cf5-bc79ff761608\",\"type\":\"LinearScale\"}},\"id\":\"ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"e7552735-9810-43f5-9127-923d6d114bb1\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"8355bf3b-4562-4c1b-9cf5-bc79ff761608\",\"type\":\"LinearScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"bd0c3ed7-4b3a-48e4-9cba-32c36d75b882\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5a808ba7-2c09-45e7-a11d-ef7c7b9e76e7\",\"type\":\"BasicTicker\"}},\"id\":\"1d54d1f3-b5c2-48e0-9e41-1266447489fb\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"780b91fb-2b10-4708-8622-93616a0f5d6a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"780b91fb-2b10-4708-8622-93616a0f5d6a\",\"type\":\"ColumnDataSource\"}},\"id\":\"fd3cf6bf-e2d8-4539-8d79-34a9e60e7cb9\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null},\"id\":\"4d0241a4-bb06-4a04-af9c-6e4aac22b366\",\"type\":\"DataRange1d\"}],\"root_ids\":[\"ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"bac4355e-548c-433a-a629-80be9b8fa25f\",\"elementid\":\"2a078516-9ea0-427b-832d-840c898a2dbb\",\"modelid\":\"ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "ccdc76a1-eec3-4f1a-9cfb-a43f70ac8b1c"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = figure(plot_width=400, plot_height=400)\n",
    "p.circle([1,2,3,4,5], [2,5,8,2,7], size=10)\n",
    "\n",
    "# change just some things about the x-grid\n",
    "p.xgrid.grid_line_color = None\n",
    "\n",
    "# change just some things about the y-grid\n",
    "p.ygrid.band_fill_alpha = 0.1\n",
    "p.ygrid.band_fill_color = \"navy\"\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE Create a plot of your own and customize several grid properties\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
